package com.ruoyi.project.naming.namingzi.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.naming.namingzi.domain.NamingZi;
import com.ruoyi.project.naming.namingzi.mapper.NamingZiMapper;
import com.ruoyi.project.naming.namingzi.service.INamingZiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 起名用字Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-11-29
 */
@Service
@DataSource(DataSourceType.DICT)
public class NamingZiServiceImpl implements INamingZiService {

    @Autowired
    private NamingZiMapper namingZiMapper;

    /**
     * 查询起名用字
     *
     * @param id 起名用字ID
     * @return 起名用字
     */
    @Override
    public NamingZi selectNamingZiById(Long id) {
        return namingZiMapper.selectNamingZiById(id);
    }

    /**
     * 查询起名用字列表
     *
     * @param namingZi 起名用字
     * @return 起名用字
     */
    @Override
    public List<NamingZi> selectNamingZiList(NamingZi namingZi) {
        return namingZiMapper.selectNamingZiList(namingZi);
    }

    /**
     * 新增起名用字
     *
     * @param namingZi 起名用字
     * @return 结果
     */
    @Override
    public int insertNamingZi(NamingZi namingZi) {
        return namingZiMapper.insertNamingZi(namingZi);
    }

    /**
     * 修改起名用字
     *
     * @param namingZi 起名用字
     * @return 结果
     */
    @Override
    public int updateNamingZi(NamingZi namingZi) {
        return namingZiMapper.updateNamingZi(namingZi);
    }

    /**
     * 删除起名用字对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteNamingZiByIds(String ids) {
        return namingZiMapper.deleteNamingZiByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除起名用字信息
     *
     * @param id 起名用字ID
     * @return 结果
     */
    @Override
    public int deleteNamingZiById(Long id) {
        return namingZiMapper.deleteNamingZiById(id);
    }
}
